<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../static/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="../static/css/global.css"  media="all">
    <!--link rel="stylesheet"  href="https://heerey525.github.io/layui-v2.4.3/layui-v2.4.5/css/layui.css" media="all"-->
</head>
<body>
<table id="demo" lay-filter="test"></table>

<script src="../static/layui/layui.js"></script>
<script>
layui.use('table', function(){
  var table = layui.table;

  //第一个实例
  table.render({
    elem: '#demo'
    ,height: 312
    ,url: '/demo/table/user/' //数据接口
    ,page: true //开启分页
    ,cols: [[ //表头
      {field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'}
      ,{field: 'question', title: '问题', width:80}
      ,{field: 'answer', title: '回答', width:80}
    ]]
  });

});
</script>
</body>
</html>